home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Snippets / Networking / Transition Queue Watcher / ATQWatcherGlue.a < prev    next >
Encoding:
Text File  |  1993-01-08  |  4.2 KB  |  130 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TESample
  7. ;
  8. ;    TESampleGlue.a    -    Assembler Source
  9. ;
  10. ;    Copyright © Apple Computer, Inc. 1989-1990
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    
  14. ;                1.00                02/92
  15. ;
  16. ;    Change History:
  17. ;                1/7/93    RRK        Added LAPAddATQFix and LAPRmvATQFix
  18. ;                                routines to use instead of the calls in
  19. ;                                the Interface.o file which has bad glue
  20. ;                                Glue code leaves 2 additional bytes on the
  21. ;                                stack.
  22. ;
  23. ;    Components:
  24. ;                ATQWatcher.p            Feb.  1, 1990
  25. ;                ATQWatcherGlue.a        Feb.  1, 1990
  26. ;                ATQWatcher.r            Feb.  1, 1990
  27. ;                ATQWatcher.h            Feb.  1, 1990
  28. ;                ATQCGlue.c                Feb.  1, 1990
  29. ;                ATQFix.c                Jan.  7, 1993
  30. ;                makefile                Feb.  1, 1990
  31. ;
  32. ;
  33. ;    TESample is an example application that demonstrates how 
  34. ;    to initialize the commonly used toolbox managers, operate 
  35. ;    successfully under MultiFinder, handle desk accessories and 
  36. ;    create, grow, and zoom windows. The fundamental TextEdit 
  37. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  38. ;    also shows how to create and maintain scrollbar controls.
  39. ;
  40. ;    It does not by any means demonstrate all the techniques you 
  41. ;    need for a large application. In particular, Sample does not 
  42. ;    cover exception handling, multiple windows/documents, 
  43. ;    sophisticated memory management, printing, or undo. All of 
  44. ;    these are vital parts of a normal full-sized application.
  45. ;
  46. ;    This application is an example of the form of a Macintosh 
  47. ;    application; it is NOT a template. It is NOT intended to be 
  48. ;    used as a foundation for the next world-class, best-selling, 
  49. ;    600K application. A stick figure drawing of the human body may 
  50. ;    be a good example of the form for a painting, but that does not 
  51. ;    mean it should be used as the basis for the next Mona Lisa.
  52. ;
  53. ;    We recommend that you review this program or Sample before 
  54. ;    beginning a new application. Sample is a simple app. which doesn’t 
  55. ;    use TextEdit or the Control Manager.
  56. ;
  57.  
  58. ;
  59. ;    AsmClikLoop
  60. ;
  61. ;    This routine gets called by the TextEdit Manager from TEClick.
  62. ;    It calls the old, default click loop routine that scrolls the
  63. ;    text, and then calls our own Pascal routine that handles
  64. ;    tracking the scroll bars to follow along.  It doesn't bother
  65. ;    with saving registers A0 and D0, because they are trashed
  66. ;    anyway by TextEdit.
  67. ;
  68.  
  69. AsmClikLoop    PROC        EXPORT
  70.  
  71.             IMPORT        GETOLDCLIKLOOP
  72.             IMPORT        PASCALCLIKLOOP
  73.             
  74.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  75.             CLR.L        -(SP)                ; make space for procedure pointer
  76.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  77.             MOVEA.L        (SP)+,A0            ; into A0
  78.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  79.             
  80.             JSR            (A0)                ; and execute old clikLoop
  81.  
  82.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  83.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  84.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  85.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  86.             RTS
  87.             ENDP
  88.  
  89.  
  90. ;    LAPAddATQFix
  91. ;   pascal OSErr LAPAddATQFix(ATQEntryPtr theATQEntry);
  92. ;
  93. ;    This routine correctly processes the call to the LAP Manager
  94. ;    to add a transition queue entry
  95. ;
  96.  
  97. LAPAddATQFix    PROC     EXPORT
  98.              
  99.             MOVE.W         #$0017,D0               ; D0 selector $0017 = LAPAddATQ
  100.             MOVEA.L     $0004(A7),A0        ; A0 -> ATQ Proc
  101.             MOVEA.L     $0B18,A1            ; Set up to call LAP Manager
  102.             MOVE.L      (A7)+,(A7)            ; Move return address up 4 bytes
  103.             JSR         $0002(A1)            ; call LAP Manager
  104.             MOVEA.L     (A7)+,A0            ; Move return address into A0
  105.             MOVE.W      D0,(A7)                ; Move result into space reserved on stack
  106.             JMP         (A0)                ; Return
  107.             
  108.             ENDP
  109.  
  110. ;    LAPRmvATQFix
  111. ;   pascal OSErr LAPAddATQFix(ATQEntryPtr theATQEntry);
  112. ;
  113. ;    This routine correctly processes the call to the LAP Manager
  114. ;    to remove a transition queue entry
  115. ;
  116.  
  117. LAPRmvATQFix    PROC     EXPORT
  118.              
  119.             MOVE.W         #$0018,D0               ; D0 selector $0018 = LAPRmvATQ
  120.             MOVEA.L     $0004(A7),A0        ; A0 -> ATQ Proc
  121.             MOVEA.L     $0B18,A1            ; Set up to call LAP Manager
  122.             MOVE.L      (A7)+,(A7)            ; Move return address up 4 bytes
  123.             JSR         $0002(A1)            ; call LAP Manager
  124.             MOVEA.L     (A7)+,A0            ; Move return address into A0
  125.             MOVE.W      D0,(A7)                ; Move result into space reserved on stack
  126.             JMP         (A0)                ; Return
  127.             
  128.             ENDP
  129.  
  130.             END